@extends('admin.public.base')


@section('title', '添加子栏目')

@section('content')

    <form class="form-horizontal" action="/admin/category" method="post">
        @csrf
        <div class="form-group">
            <label for="name" class="col-sm-2 control-label">上级栏目</label>
            <div class="col-sm-10">
                <select name="pid" class="form-control">
                    <option value="0">顶级栏目</option>
                    @foreach($categorys as $category)
                        <option value="{{$category['id']}}"
                                @if($category['id'] == $id)
                                selected
                                @endif
                        >{!!$category['_name']!!}</option>
                    @endforeach
                </select>
            </div>
        </div>

        <div class="form-group">
            <label for="name" class="col-sm-2 control-label">栏目名称</label>
            <div class="col-sm-10">
                <input type="text" name="name" class="form-control" id="name" placeholder="输入栏目名称">
            </div>
        </div>

        <div class="form-group">
            <label for="describe" class="col-sm-2 control-label">栏目描述</label>
            <div class="col-sm-10">
                <input type="text" name="describe" class="form-control" id="describe"
                       placeholder="栏目描述">
            </div>
        </div>

        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="submit" class="btn btn-default">确认</button>
            </div>
        </div>
    </form>

@endsection
